#include<bits/stdc++.h> 

using namespace std;

using ll  = long long ;
ll ans = 0;
ll count_sw(ll x)
{
    ll cnt = 0;
    while(x)
    {
        cnt+=x%10;
        x /= 10;
    }
    return cnt;
}
int main( )
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(ll i=1;i<=n;i++)
    {
        ll x;
        cin >> x;
        ans += count_sw(x);
    }
    cout << ans;
    return 0;
}